package com.ocom.ugcapi.client;

import com.alibaba.fastjson.JSONObject;
import com.ocom.common.constant.CompanyServiceUrl;
import com.ocom.common.dto.GetCompanyRoleListDto;
import com.ocom.common.entity.company.EntityCompanyConfig;
import com.ocom.common.entity.company.EntityFlowConfig;
import com.ocom.common.entity.human.EntityBizLeaveApply;
import com.ocom.common.entity.master.EntityMngUserInfo;
import com.ocom.common.entity.master.EntityWechatAppInfo;
import com.ocom.common.entity.pay.EntityAppConfig;
import com.ocom.common.request.company.*;
import com.ocom.common.request.human.LeaveApplyDetailRequest;
import com.ocom.common.request.human.NewLeaveApplyRequest;
import com.ocom.common.request.ugcapi.GzhUserLeaveList;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.PageListResult;
import com.ocom.common.vo.company.CompanyRoleListVo;
import com.ocom.common.vo.company.FlowConfigVo;
import com.ocom.common.vo.company.GetFlowApprovalDetailVo;
import com.ocom.common.vo.company.GzhPerInfoVo;
import com.ocom.common.vo.human.LeaveApplyDetailVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@FeignClient(value = "company")
public interface CompanyClientService {

    @PostMapping(CompanyServiceUrl.URL_getCompanyInfoById)
    public Result getCompanyInfoById(@RequestParam("companyId")Long companyId);

    @PostMapping(CompanyServiceUrl.URL_getAppFunc)
    public Result getAppFunc(@RequestParam("comId")Long comId,@RequestParam("appId")String appId);

    @PostMapping(CompanyServiceUrl.URL_setAppFunc)
    public Result setAppFunc(@RequestBody EntityAppConfig entityAppConfig);

    @PostMapping(CompanyServiceUrl.URL_getAppInfo)
    public Result getAppInfo(@RequestParam("comId")Long comId , @RequestParam("appId")String appId);

    @PostMapping(CompanyServiceUrl.URL_setAppInfo)
    public Result setAppInfo(@RequestBody EntityWechatAppInfo entityWechatAppInfo);

    @PostMapping(CompanyServiceUrl.URL_getAppInfoByName)
    public Result getAppInfoByName(@RequestParam("appName")String appName);

    @PostMapping(CompanyServiceUrl.URL_getCompanyListByAgentGzh)
    public Result getCompanyListByAgentGzh(@RequestParam("agentAppid")String agentAppid,@RequestParam("bingRegister")Integer bingRegister);

    @PostMapping(CompanyServiceUrl.URL_getPersonListByOpenid)
    public Result<List<GzhPerInfoVo>> getPersonListByOpenid(@RequestParam("openid")String openid, @RequestParam("appid")String appid);

    @PostMapping(CompanyServiceUrl.URL_urlBindRegister)
    public Result urlBindRegister(@RequestParam("bind") Integer bind,
                                  @RequestParam("register") Integer register);

    @PostMapping(CompanyServiceUrl.URL_getGzhListOfCom)
    public Result getGzhListOfCom(@RequestBody GetGzhListOfComRequest request);

    @PostMapping(CompanyServiceUrl.URL_getGzhCodeOfCom)
    public Result getGzhCodeOfCom(@RequestParam("comId")Long comId);


    @PostMapping(CompanyServiceUrl.URL_GetRegCodeInfoOne)
    public Result GetRegCodeInfo(@RequestParam("regCode")String regCode);


    @PostMapping(CompanyServiceUrl.URL_getSeverReplyApiPara)
    public Result getSeverReplyApiPara(@RequestBody GetSeverReplyApiParaRequest request) ;

    @PostMapping(CompanyServiceUrl.URL_getReplyApiPara)
    public Result getReplyApiPara(@RequestBody GetReplyApiParaRequest request) ;

    /**
    @PostMapping(CompanyServiceUrl.URL_getCompanyConfig)
    public Result getCompanyConfig(@RequestParam("comId")Long comId) ;
    */

    /**
     * 3.22获取单位功能配置列表(getCompanyConfig)
     */
    @PostMapping(CompanyServiceUrl.URL_getCompanyConfig)
    public Result<List<EntityCompanyConfig>> getCompanyConfig(@RequestParam("comId") Long companyId, @RequestParam("tab")String tab);


    /**
     * 3.23新增单位功能配置(addCompanyConfig)
     */
    @PostMapping(CompanyServiceUrl.URL_addCompanyConfig)
    public Result addCompanyConfig(@RequestBody EntityCompanyConfig request);

    /**
     * 3.24更新单位功能配置(updateCompanyConfig)
     */
    @PostMapping(CompanyServiceUrl.URL_updateCompanyConfig)
    public Result updateCompanyConfig(@RequestBody EntityCompanyConfig request);
    /**
     * 3.25删除单位功能配置(removeCompanyConfig)
     */
    @PostMapping(CompanyServiceUrl.URL_removeCompanyConfig)
    public Result removeCompanyConfig(@RequestParam("comId") Long companyId, @RequestParam("tab")String tab);

    @PostMapping(CompanyServiceUrl.URL_getCompanyRole)
    public Result<List<CompanyRoleListVo>> getCompanyRole(@RequestBody GetCompanyRoleListDto dto);

    @PostMapping(CompanyServiceUrl.URL_getFlowkeyByPid)
    public Result<FlowConfigVo> getFlowkeyByPid(@RequestBody GetFlowkeyByPidRequest getFlowkeyByPidRequest);

    @PostMapping(CompanyServiceUrl.URL_getApplyListByPid)
    public Result getApplyListByPid(@RequestBody GetApplyListByPidRequest getApplyListByPidRequest);

    @PostMapping(CompanyServiceUrl.URL_getFlowListByCom)
    public Result<EntityFlowConfig> getFlowListByCom(@RequestBody GetFlowListByComRequest getFlowListByComRequest);


    @PostMapping(CompanyServiceUrl.URL_getFlowApprovalDetail)
    public  Result<List<GetFlowApprovalDetailVo>> getFlowApprovalDetail(@RequestBody GetFlowApprovalDetailRequest getFlowApprovalDetailRequest);

    @PostMapping(CompanyServiceUrl.URL_cancelApply)
    public  Result cancelApply(@RequestBody CancelApplyRequest cancelApplyRequest);

    @PostMapping(CompanyServiceUrl.URL_newApply)
    public Result newApply(@RequestBody NewApplyRequest applyRequest);

    @PostMapping(CompanyServiceUrl.URL_addLeavelApply)
    public Result addLeavelApply(@RequestBody EntityBizLeaveApply entityBizLeaveApply);

    @PostMapping(CompanyServiceUrl.URL_updateLeavelApply)
    public Result updateLeavelApply(@RequestBody EntityBizLeaveApply entityBizLeaveApply);

    @PostMapping(CompanyServiceUrl.URL_leavelApplyList)
    public Result leavelApplyList(@RequestBody GzhUserLeaveList request);

    @PostMapping(CompanyServiceUrl.URL_leavelApplyOne)
    public Result<EntityBizLeaveApply> leavelApplyOne(@RequestBody EntityBizLeaveApply entityBizLeaveApply);

    @PostMapping(CompanyServiceUrl.URL_GetMngUserInfo)
    public Result<PageListResult<EntityMngUserInfo>> getMngUserInfo(@RequestBody JSONObject jsonObject);

    @PostMapping(CompanyServiceUrl.URL_newLeaveApply)
    public Result<EntityBizLeaveApply> newLeaveApply(@RequestBody NewLeaveApplyRequest leaveApplyRequest);

    @PostMapping(CompanyServiceUrl.URL_leaveApplyDetail)
    public Result<LeaveApplyDetailVo> leaveApplyDetail(@RequestBody LeaveApplyDetailRequest leaveApplyDetailRequest);


}
